﻿using System;
using System.Collections.Generic;
using RIMS.Lib.DataAccess.Implementations;
using RIMS.Lib.DataAccess.Interfaces;
using RIMS.Lib.Models;

namespace RIMS.Lib.Manager
{
    public class RoleManager
    {
        private readonly IRoleDAO _RoleDAOLinq;

        public RoleManager()
        {
            _RoleDAOLinq = new RoleDAOLinq();
        }

        public IList<Role> GetAll()
        {
            return _RoleDAOLinq.All();
        }

        public Role PickByOID(Guid oid)
        {
            return _RoleDAOLinq.PickByOID(oid);
        }

        public bool Save(Role role)
        {
            try
            {
                return _RoleDAOLinq.Add(role);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}